import Vue from "vue"
import Router from "vue-router"

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: __dirname,
  //base: '/back/',
  routes: [
    { path: '*', component: () => import('@/view/404') }, // 404
    { path: '/main/login', component: () => import('@/view/login/login') },  //重定向到首页
    { path: '/', redirect: '/main/index/index' }, // 重定向到首页
    {
      path: '/main', component: () => import('@/view/main/main'), redirect: '/main/index/index', children: [// redirect重定向默认第一个列表
        //首页
        { path: '/main/index/index', component: () => import('@/view/index/index'), meta: { menu: '首页', children: '' } },
        //商户管理
        { path: '/main/busnt/addant', component: () => import('@/view/busnt/addant'), meta: { menu: '商户管理', children: '新增商户' } },
        { path: '/main/busnt/category', component: () => import('@/view/busnt/category'), meta: { menu: '商户管理', children: '平台品类' } },
        { path: '/main/busnt/categorys', component: () => import('@/view/busnt/categorys'), meta: { menu: '商户管理', children: '品类管理' } },
        { path: '/main/busnt/list', component: () => import('@/view/busnt/list'), meta: { menu: '商户管理', children: '商户列表' } },
        { path: '/main/busnt/ranking', component: () => import('@/view/busnt/ranking'), meta: { menu: '商户管理', children: '商户排名' } },
        { path: '/main/busnt/add1', component: () => import('@/view/busnt/add1'), meta: { menu: '商户管理', children: '新增/修改商户第一步' } },
        { path: '/main/busnt/add2', component: () => import('@/view/busnt/add2'), meta: { menu: '商户管理', children: '新增/修改商户第二步' } },
        { path: '/main/busnt/add3', component: () => import('@/view/busnt/add3'), meta: { menu: '商户管理', children: '新增/修改商户第三步' } },
        { path: '/main/busnt/check', component: () => import('@/view/busnt/check'), meta: { menu: '商户管理', children: '商户详情' } },
        { path: '/main/busnt/joinList', component: () => import('@/view/busnt/joinList'), meta: { menu: '商户管理', children: '入驻列表' } },
        //订单管理
        { path: '/main/order/index', component: () => import('@/view/order/index'), meta: { menu: '订单管理', children: '订单列表' } },
        { path: '/main/order/eval', component: () => import('@/view/order/eval'), meta: { menu: '订单管理', children: '评价列表' } },

        //订单调度
        { path: '/main/adjust/adjust', component: () => import('@/view/adjust/adjust'), meta: { menu: '订单调度', children: '' } },

        //商品管理
        { path: '/main/comdty/index', component: () => import('@/view/comdty/index'), meta: { menu: '商品管理', children: '商家商品' } },
        { path: '/main/comdty/list', component: () => import('@/view/comdty/list'), meta: { menu: '商品管理', children: '商品列表' } },
        { path: '/main/comdty/check', component: () => import('@/view/comdty/check'), meta: { menu: '商品管理', children: '编辑商品' } },
        { path: '/main/comdty/addcom', component: () => import('@/view/comdty/addcom'), meta: { menu: '商品管理', children: '新增/修改商品' } },
        //活动管理
        { path: '/main/activity/pron', component: () => import('@/view/activity/pron'), meta: { menu: '活动管理', children: '创建活动' } },
        { path: '/main/activity/set', component: () => import('@/view/activity/set'), meta: { menu: '活动管理', children: '活动列表' } },
        { path: '/main/activity/fullless', component: () => import('@/view/activity/fullless'), meta: { menu: '活动管理', children: '新增满减活动' } },
        { path: '/main/activity/cfullless', component: () => import('@/view/activity/cfullless'), meta: { menu: '活动管理', children: '设置满减' } },
        { path: '/main/activity/item', component: () => import('@/view/activity/item'), meta: { menu: '活动管理', children: '新增单品活动' } },
        { path: '/main/activity/citem', component: () => import('@/view/activity/citem'), meta: { menu: '活动管理', children: '设置单品活动' } },
        { path: '/main/activity/delivery', component: () => import('@/view/activity/delivery'), meta: { menu: '活动管理', children: '新增配送活动' } },
        { path: '/main/activity/cdelivery', component: () => import('@/view/activity/cdelivery'), meta: { menu: '活动管理', children: '设置配送活动' } },
        { path: '/main/activity/newuser', component: () => import('@/view/activity/newuser'), meta: { menu: '活动管理', children: '新增新用户活动' } },
        { path: '/main/activity/cnewuser', component: () => import('@/view/activity/cnewuser'), meta: { menu: '活动管理', children: '设置新用户活动' } },
        { path: '/main/activity/aglenbox', component: () => import('@/view/activity/aglenbox'), meta: { menu: '活动管理', children: '新增区域红包' } },
        { path: '/main/activity/orderbox', component: () => import('@/view/activity/orderbox'), meta: { menu: '活动管理', children: '新增下单返红包' } },
        { path: '/main/activity/shopbox', component: () => import('@/view/activity/shopbox'), meta: { menu: '活动管理', children: '新增商家红包' } },
        { path: '/main/activity/aearmj', component: () => import('@/view/activity/aearmj'), meta: { menu: '活动管理', children: '大额满减专区' } },
        { path: '/main/activity/aearps', component: () => import('@/view/activity/aearps'), meta: { menu: '活动管理', children: '免配送费专区' } },
        { path: '/main/activity/aearth', component: () => import('@/view/activity/aearth'), meta: { menu: '活动管理', children: '优选专区' } },
        { path: '/main/activity/interests', component: () => import('@/view/activity/interests'), meta: { menu: '活动管理', children: '用户权益' } },
        { path: '/main/activity/vipset', component: () => import('@/view/activity/vipset'), meta: { menu: '活动管理', children: '会员设置' } },
        { path: '/main/activity/viplist', component: () => import('@/view/activity/viplist'), meta: { menu: '活动管理', children: '会员列表' } },
        { path: '/main/activity/share', component: () => import('@/view/activity/share'), meta: { menu: '活动管理', children: '分享设置' } },
        { path: '/main/activity/sharenotes', component: () => import('@/view/activity/sharenotes'), meta: { menu: '活动管理', children: '分享记录' } },
        { path: '/main/activity/invited', component: () => import('@/view/activity/invited'), meta: { menu: '活动管理', children: '邀请有奖' } },
        { path: '/main/activity/invitednotes', component: () => import('@/view/activity/invitednotes'), meta: { menu: '活动管理', children: '邀请记录' } },
        { path: '/main/activity/intel', component: () => import('@/view/activity/intel'), meta: { menu: '活动管理', children: '积分兑换设置' } },
        { path: '/main/activity/intellist', component: () => import('@/view/activity/intellist'), meta: { menu: '活动管理', children: '兑换记录' } },
        //布局管理
        { path: '/main/layout/class', component: () => import('@/view/layout/class'), meta: { menu: '布局管理', children: '首页分类图标' } },
        { path: '/main/layout/advg', component: () => import('@/view/layout/advg'), meta: { menu: '布局管理', children: '首页轮播列表' } },
        { path: '/main/layout/aciivity', component: () => import('@/view/layout/aciivity'), meta: { menu: '布局管理', children: '首页活动推荐' } },
        { path: '/main/layout/advert', component: () => import('@/view/layout/advert'), meta: { menu: '布局管理', children: '首页广告位' } },

        //数据中心
        { path: '/main/data/order', component: () => import('@/view/data/order'), meta: { menu: '数据中心', children: '订单数据' } },
        { path: '/main/data/dashd', component: () => import('@/view/data/dashd'), meta: { menu: '数据中心', children: '数据统计' } },
        { path: '/main/data/item', component: () => import('@/view/data/item'), meta: { menu: '数据中心', children: '数据分析' } },

        //区域管理
        { path: '/main/agent/service', component: () => import('@/view/agent/service'), meta: { menu: '基础设置', children: '客服设置' } },
        { path: '/main/agent/role', component: () => import('@/view/agent/role'), meta: { menu: '基础设置', children: '部门设置' } },
        { path: '/main/agent/user', component: () => import('@/view/agent/user'), meta: { menu: '基础设置', children: '人员设置' } },
        { path: '/main/agent/agree', component: () => import('@/view/agent/agree'), meta: { menu: '基础设置', children: '使用协议' } },
        { path: '/main/agent/delivery', component: () => import('@/view/agent/delivery'), meta: { menu: '基础设置', children: '配送设置' } },
        { path: '/main/agent/setdey', component: () => import('@/view/agent/setdey'), meta: { menu: '基础设置', children: '新增/修改配送模板' } },

        //骑手管理
        { path: '/main/knight/lvlup', component: () => import('@/view/knight/lvlup'), meta: { menu: '骑手管理', children: '骑手等级' } },
        { path: '/main/knight/info', component: () => import('@/view/knight/info'), meta: { menu: '骑手管理', children: '骑手信息' } },
        { path: '/main/knight/joinList', component: () => import('@/view/knight/joinList'), meta: { menu: '商户管理', children: '骑手申请列表' } },
        //财务管理
        { path: '/main/finance/total', component: () => import('@/view/finance/total'), meta: { menu: '财务管理', children: '财务统计' } },
        { path: '/main/finance/delivery', component: () => import('@/view/finance/delivery'), meta: { menu: '财务管理', children: '配送统计' } },
        { path: '/main/finance/wrecord', component: () => import('@/view/finance/wrecord'), meta: { menu: '财务管理', children: '商家提现记录' } },
        { path: '/main/finance/wapplyfor', component: () => import('@/view/finance/wapplyfor'), meta: { menu: '财务管理', children: '商家提现申请' } },
        { path: '/main/finance/sales', component: () => import('@/view/finance/sales'), meta: { menu: '财务管理', children: '商家销量统计' } },
        //通知
        { path: '/main/inform/index', component: () => import('@/view/inform/index'), meta: { menu: '通知', children: '' } },
        //发布通知
        { path: '/main/issue/index', component: () => import('@/view/issue/index'), meta: { menu: '发布通知', children: '' } },
        //公司管理
        { path: '/main/company/area', component: () => import('@/view/company/area'), meta: { menu: '系统管理', children: '区域列表' } },
        { path: '/main/company/setarea', component: () => import('@/view/company/setarea'), meta: { menu: '系统管理', children: '区域管理' } },
        { path: '/main/company/list', component: () => import('@/view/company/list'), meta: { menu: '系统管理', children: '区域列表' } },
        { path: '/main/company/list1', component: () => import('@/view/company/list1'), meta: { menu: '系统管理', children: '加盟区域' } },
        { path: '/main/company/city', component: () => import('@/view/company/city'), meta: { menu: '系统管理', children: '城市经理列表' } },
        { path: '/main/company/setcity', component: () => import('@/view/company/setcity'), meta: { menu: '系统管理', children: '城市经理管理' } },
        { path: '/main/company/user', component: () => import('@/view/company/user'), meta: { menu: '系统管理', children: '人员设置' } },
        { path: '/main/company/jurtion', component: () => import('@/view/company/jurtion'), meta: { menu: '系统管理', children: '菜单权限' } },
        { path: '/main/company/role', component: () => import('@/view/company/role'), meta: { menu: '系统管理', children: '部门设置' } },
        { path: '/main/company/add', component: () => import('@/view/company/add'), meta: { menu: '系统管理', children: '新增/编辑区域' } },
        { path: '/main/company/auditing', component: () => import('@/view/company/auditing'), meta: { menu: '系统管理', children: '红包审核' } },
        { path: '/main/company/appManage', component: () => import('@/view/company/appManage'), meta: { menu: '系统管理', children: 'app管理' } },
        { path: '/main/company/payList', component: () => import('@/view/company/payList'), meta: { menu: '系统管理', children: '支付列表' } },
        { path: '/main/company/paySet', component: () => import('@/view/company/paySet'), meta: { menu: '系统管理', children: '支付列表' } },
        //用户管理
        { path: '/main/user/list', component: () => import('@/view/user/list'), meta: { menu: '用户管理', children: '用户列表' } },
        { path: '/main/user/message', component: () => import('@/view/user/message'), meta: { menu: '用户管理', children: '用户订单' } },

        //跑腿首页
        { path: '/main/fwindex/index', component: () => import('@/view/fwindex/index'), meta: { menu: '跑腿首页', children: '' } },
        //跑腿订单
        { path: '/main/fworder/index', component: () => import('@/view/fworder/index'), meta: { menu: '跑腿订单', children: '' } },
        //跑腿业务
        { path: '/main/fwbeset/list', component: () => import('@/view/fwbeset/list'), meta: { menu: '跑腿业务', children: '收费方案列表' } },
        { path: '/main/fwbeset/check', component: () => import('@/view/fwbeset/check'), meta: { menu: '跑腿业务', children: '新增/编辑方案' } },
        //跑腿活动管理
        { path: '/main/fwactivity/set', component: () => import('@/view/fwactivity/set'), meta: { menu: '跑腿活动', children: '活动列表' } },
        { path: '/main/fwactivity/aglenbox', component: () => import('@/view/fwactivity/aglenbox'), meta: { menu: '跑腿活动', children: '新增优惠券' } },
        { path: '/main/fwactivity/newuser', component: () => import('@/view/fwactivity/newuser'), meta: { menu: '跑腿活动', children: '新增新用户活动' } },
        //跑腿财务
        { path: '/main/fwtotal/index', component: () => import('@/view/fwtotal/index'), meta: { menu: '跑腿财务', children: '财务统计' } },
        { path: '/main/fwtotal/tshoper', component: () => import('@/view/fwtotal/tshoper'), meta: { menu: '跑腿财务', children: '骑手统计' } },
        // 会员
        { path: '/main/member/info', component: () => import('@/view/member/info'), meta: { menu: '会员管理', children: '账户余额' } },
        { path: '/main/member/record', component: () => import('@/view/member/record'), meta: { menu: '会员管理', children: '账户余额' } },
        { path: '/main/member/list', component: () => import('@/view/member/list'), meta: { menu: '会员管理', children: '会员列表' } },
        { path: '/main/member/card', component: () => import('@/view/member/card'), meta: { menu: '会员管理', children: '会员卡' } },

        // 相册
        { path: '/main/photo', component: () => import('@/view/photo'), meta: { menu: '相册', children: '个人相册' } },

        // 商城 商家
        { path: '/main/sc_shop/shopList', component: () => import('@/view/sc_shop/shopList'), meta: { menu: '商城商家管理', children: '商家列表' } },
        { path: '/main/sc_shop/shopGoods', component: () => import('@/view/sc_shop/shopGoods'), meta: { menu: '商城商家管理', children: '商家商品' } },
        { path: '/main/sc_shop/addShop', component: () => import('@/view/sc_shop/addShop'), meta: { menu: '商城商家管理', children: '新增/修改商家' } },
        { path: '/main/sc_shop/goodsList', component: () => import('@/view/sc_shop/goodsList'), meta: { menu: '商城商家管理', children: '商品管理' } },
        { path: '/main/sc_shop/goodsDisc', component: () => import('@/view/sc_shop/goodsDisc'), meta: { menu: '商城商家管理', children: '商品详情模板' } },
        { path: '/main/sc_shop/goodsDelivery', component: () => import('@/view/sc_shop/goodsDelivery'), meta: { menu: '商城商家管理', children: '运费模板' } },
        { path: '/main/sc_shop/addDelivery', component: () => import('@/view/sc_shop/addDelivery'), meta: { menu: '商城商家管理', children: '新建运费模板' } },
        { path: '/main/sc_shop/addGoods', component: () => import('@/view/sc_shop/addGoods'), meta: { menu: '商城商家管理', children: '新增/修改商品' } },
        // 商城 商品
        { path: '/main/sc_goods/class', component: () => import('@/view/sc_goods/class'), meta: { menu: '商城商品管理', children: '新增/修改商品分类' } },

        { path: '/main/sc_goods/all', component: () => import('@/view/sc_goods/all'), meta: { menu: '商城商家管理', children: '商品列表' } },
      ]
    }
  ]
})
